﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CoVanHocTapData.Infrastructure;
using CoVanHocTapData.Entities;

namespace CoVanHocTapData.Concretes
{
    public class KhoiChuongTrinhDaoTaoRepository:IKhoiChuongTrinhDaoTaoRepository
    {
        DangKyPhuEntities entites;
        public KhoiChuongTrinhDaoTaoRepository()
        {
            entites = new DangKyPhuEntities();
        }

        #region IKhoiChuongTrinhDaoTaoRepository Members

        public IQueryable<Entities.KhoiChuongTrinhDaoTao> LayKhoiCTDT(string nganhID, int nienKhoaID, string heDaoTaoID)
        {
            return (from m in entites.KhoiChuongTrinhDaoTaos
                    where m.NganhID.Equals(nganhID)
                    && m.NienKhoaID.Value == nienKhoaID
                    && m.HeDaoTaoID.Equals(heDaoTaoID)
                    
                    select m);
        }

        public IQueryable<Entities.KhoiChuongTrinhDaoTao> LayKhoiCTDT(string nganhID, int nienKhoaID, string heDaoTaoID, string hocKyID)
        {
            return (from m in entites.KhoiChuongTrinhDaoTaos
                       where m.NganhID.Equals(nganhID)
                       && m.NienKhoaID.Value == nienKhoaID
                       && m.HeDaoTaoID.Equals(heDaoTaoID)
                       && m.HocKys == hocKyID
                       select m);
        }

        #endregion
    }
}
